package com.bing.services.impl;

import com.bing.bean.weixin.*;
import com.bing.dao.AccountDao;
import com.bing.dao.UserDao;
import com.bing.services.AccountService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by Administrator on 2014/12/9.
 */

@Service
@Transactional
public class AccountServiceImpl implements AccountService {
    @Autowired
    private AccountDao accountDao;
    @Autowired
    private UserDao userDao;
    private Logger logger = LoggerFactory.getLogger(AccountServiceImpl.class);


    @Override
    public Account findByUrl(String url) {
        logger.info("findByUrl:{}", url);
        return accountDao.findByUrl(url);
    }

    @Override
    public List<Account> findByTypeAndStatus(AccountType accountType, AccountStatus accountStatus) {
        return accountDao.findByTSS(accountType, accountStatus);
    }

    @Override
    public List<User> findUsers(Account account) {
        return accountDao.findUsers(account);
    }

    @Override
    public List<Account> findAccounts() {
        return accountDao.findAccounts();
    }

    @Override
    public List<ResponseMessage> findCommands(Account account) {
        return accountDao.findCommands(account);
    }


}
